<!doctype html>
<html lang="en" ng-app="detailApp">
<head>
    <meta charset="UTF-8">
    <title>活动详情</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta name="format-detection" content="telephone=no"/>
    <link href="css/66.css" rel="stylesheet" type="text/css"/>
    <script src="lib/jquery-2.1.1.min.js" type="text/javascript"></script>
    <script src="lib/idangerous.swiper.js" type="text/javascript"></script>
    <script src="lib/angular/angular.min.js" type="text/javascript"></script>
    <script src="lib/angular/angular-route.min.js" type="text/javascript"></script>
    <script src="lib/angular/angular-resource.min.js" type="text/javascript"></script>
    <script src="js/detail.js"></script>
    <script src="js/filters.js"></script>
</head>
<body ng-controller="ActivityDetailCtrl" class="activedetail-body">
<div class="wrapper activedetail">
    <div class="swiper-container">
        <div class="swiper-wrapper">
        </div>
        <div class="pagination"></div>
    </div>
    <div class="clearfix count">
        <span class="fl">已参加&nbsp;<em class="num">{{activity.partakeCount}}<sub>人</sub></em></span>
        <span class="fr">费用<em class="num" id="charge"></em></span>
    </div>
    <div class="time-address">
        <p><span class="time"><img src="images/active_time.png">报名时间</span>{{activity.beginDate}}至{{activity.endDate}}
        </p>

        <p><span class="address"><img src="images/active_address.png">活动地点</span>{{activity.address}}</p>
    </div>
    <p class="detail-t"><span>活动详情</span></p>

    <div class="explain">
        <pre>{{activity.desc}}</pre>
    </div>

    <p class="detail-t"><span>活动说明</span></p>

    <div class="explain">
        <pre>{{activity.explain}}</pre>
    </div>
    <div class="h48"></div>
</div>
<div class="pop cancleJon">
    <div class="cancleJon-con"><img src="images/active_ok.png"><br/>报名成功</div>
</div>
<div class="pop information">
    <form onclick="return false" class="info-form">
        <a href="javascript:;" class="close"></a>

        <p class="info-form-t">填写报名信息</p>
        <input type="text" placeholder="请输入手机号" class="text" maxlength="11" ng-model="phone" value="" id="mobilePhone"/>
        <textarea placeholder="请输入备注信息" class="text address" ng-model="desc" id="address"/></textarea>
        <input type="submit" value="报名参加" class="button" ng-click="partake()">
    </form>
</div>
<a href="javascript:;" class="join-a">我要报名</a>
</body>
</html>
<script>
    var checkOk = false;
    if (params.token == null || params.token == "") {
        $('.join-a').html('点击更新【宝宝树66小区】完成报名');
    }

    $(window).load(function () {
        //显示弹出层 高度适配
        var windowH = $(window).height();
        var scrollH = $('.activedetail')[0].scrollHeight;
        //隐藏弹出层
        $('.close').click(function () {
            $(this).parent().parent('.pop').hide();
        });
        //切换 报名按钮 颜色
        $('#mobilePhone').keyup(function () {
            checkform();
        });
        //切换 报名按钮 颜色
        $('#address').keyup(function () {
            checkform();
        });
        $('.join-a').click(function () {
                    if (checkOk) return;
                    if (params.token != null && params.token != "") {
                        if (windowH + 150 > scrollH) {
                            $('.information').height(windowH + 150).show();
                        } else {
                            $('.information').height(scrollH).show();
                        }
                        $('.info-form').css('top', ($('body').height() - $('.info-form').height()) / 2);
                    } else {
                        location.href = "http://a.app.qq.com/o/simple.jsp?pkgname=com.joinone.android.sixsixneighborhoods";
                    }
                }
        );
//	$('textarea').keyup(function(){
//		checkform();
//	});
    });
    function checkform() {
        if ($('#mobilePhone').val() != '' && $('#address').val() != '') {
            $('.button').addClass('button-change');
        } else {
            $('.button').removeClass('button-change');
        }
    }
    $('.button').click(function () {
        if (!($('#mobilePhone').val() != '' && $('#address').val() != '')) return;
        if (!checkOk) {
            $('.information').hide();
            $('.cancleJon').show();
            setTimeout(function () {
                $('.cancleJon').hide();
            }, 2000);
        }
    });

</script>